<?php
namespace web\common\model;

/**
 * Description of StoreBaseModel
 * 档口模型基类
 * @author shilinqing
 */
class CentreBaseModel extends BaseModel{
    
    /**
     * 所属档口ID
     * @var type 
     */
    protected $centre_id = 0;
    
    public function __construct($centre_id = 0) {
        $this->centre_id = $centre_id;
        parent::__construct();
    }
    
    /**
     * 获取条件
     * @param type $data
     * @return type
     */
    protected function getWhere($data = null) {
        if (!$data)
            $data = array();
        if ($this->centre_id > 0) {
            if($this->tableName == 'centre')
                $data['id'] = $this->centre_id;
            else
                $data['centre_id'] = $this->centre_id;
        }
        return $data;
    }
    
}
